<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>计算圆的面积和周长</title>
</head>
<body>
<script>
    function getArea(r) {
        var area = Math.PI * Math.pow(r, 2);
        return area;
    }

    function getPerimeter(r) {
        var perimeter = 2 * Math.PI * r;
        return perimeter;
    }

    var radius = 5;
    var circleArea = getArea(radius);
    alert("半径为 " + radius + " 的圆的面积为：" + circleArea.toFixed(2));

    var circlePerimeter = getPerimeter(radius);
    alert("半径为 " + radius + " 的圆的周长为：" + circlePerimeter.toFixed(2));
</script>
</body>
</html>